#!/bin/bash
echo "This is a test "

echo "build driver"

cd ./CCP907_SEC_MODULE/CCP903_SEC_BASE
echo "Current Path Is :$(pwd)"
echo "rebuild CCP907T DRIVER ?"
echo "input 'y' or 'n' :"
read is_build
if [[ "$is_build" = "y" || "$is_build" = "Y" ]]; then
    echo "to build driver"
    make clean
    make
else
    echo "will not rebulid driver"
fi

echo "Insmod CCP907T DRIVER ?"
echo "input 'y' or 'n' :"
read is_insmod
if [[ "$is_insmod" = "y" || "$is_insmod" = "Y" ]]; then
    echo "insmod  PCEI_CCP903T"
    if insmod PCIE_CCP903T.ko;then 
        echo "Driver Module Loaded Successfully."
    else 
        echo "Failth ot Loader Module.Check the Kernel Logs for more details (dmesg)"
        exit 1
    fi
else
    echo "continue! not to insmod driver!"
fi

echo "repath:"
cd -






